<template>
<div>
  <div><el-button type="primary" @click="exportOrdersBills">导出对账单</el-button></div>
  <el-table
      :data="tableData"
      stripe
      style="width: 100%">
    <el-table-column
        prop="id"
        label="订单id"
        width="180">
    </el-table-column>
    <el-table-column
        prop="orderStatus"
        label="订单状态"
        width="180">
    </el-table-column>
    <el-table-column
        prop="totalAmount"
        label="总金额">
    </el-table-column>
    <el-table-column
        prop="createTime"
        label="创建时间">
    </el-table-column>
    <el-table-column
        prop="updateTime"
        label="更新时间">
    </el-table-column>
    <el-table-column
        prop="goodsId"
        label="商品id">
    </el-table-column>
  </el-table>
</div>
</template>

<script>
export default {
  name: "OrderView",
  data() {
    return {
      tableData: []
    }
  },
  created() {
    this.getOrderList()
  },
  methods:{
    exportOrdersBills(){
      location.href="http://192.168.21.1:8888/api/order/exportOrderBill"
    },
    getOrderList(){
      this.axios.get("http://192.168.21.1:8888/api/order/orderList").then(resp=>{
        this.tableData=resp.data;
      })
    }
  }
}
</script>

<style scoped>

</style>